import React from 'react';

import {Route, Switch} from 'react-router-dom';

 import Bundle from './Bundle';
 import Loading from '../components/Loading/Loading';

// import Home from 'bundle-loader?lazy&name=home!pages/Home/Home';
// import Page1 from 'bundle-loader?lazy&name=page1!pages/Page1/Page1';
// import Counter from 'bundle-loader?lazy&name=counter!pages/Counter/Counter';
// import UserInfo from 'bundle-loader?lazy&name=userInfo!pages/UserInfo/UserInfo';
// import NotFound from 'bundle-loader?lazy&name=notFound!pages/NotFound/NotFound';


 // import Home from 'bundle-loader?lazy&name=index!pages/Home/Index';
 // import Test from 'bundle-loader?lazy&name=test!pages/Test/Test';
 //
 import Home from '../pages/Home/Index';
 import Test from '../pages/Test/Test';
const createComponent = (component) => () => (
    <Bundle load={component}>
        {
            (Component) => Component ? <Component/> : <Loading/>
        }
    </Bundle>
);

export default () => (
    <div>
        <Switch>
            <Route exact path="/" component={Home}/>
            <Route  path="/test" component={Test}>
          </Route>
        </Switch>
    </div>
);
